import { defineStore } from 'pinia'
import localforage from 'localforage'
interface InfoType {
    mobile: string;
    name: string;
    idcard: string;
    order_no: string;
}
export const useUserStore = defineStore('user', {
  state: () => ({
    info: {} as InfoType,
    idcardFaceUri:'',
    idcardBackUri:'',
    faceUri:'',
    signUri:''
  }),
  actions:{
    initStore(){
      localforage.getItem('user',(err,val) =>{
        if(val){
          this.$patch(val)
        }
      })
    }
  },
  // persist: true
})
